<template>
  <div class="search-component">
    <nut-searchbar
      v-model="val"
      placeholder="请输入商品名称"
      @search="search"
      clearable
    >
      <template #leftin>
        <Search2 /> </template
    ></nut-searchbar>
  </div>
</template>
<script setup lang="ts">
import { Search2} from '@nutui/icons-vue-taro'
import { ref } from "vue";
const val = ref("");
const search = (text: string) => {
  console.log("search", text);
};
</script>
<style lang="scss"></style>
